<template>
	<view class="goodsList">
		<GoodsItem @submitGetGoods="submitGetGoods" @openCar="openCar" v-for="(item, index) in list" :key="index"
			:itemData="item"></GoodsItem>
	</view>
</template>

<script>
	import GoodsItem from '../goodsItem/goodsItem.vue';
	export default {
		name: 'goodsList',
		components: {
			GoodsItem
		},
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {};
		},
		methods: {
			openCar(item) {
				this.$emit('openCar', item);
			},
			submitGetGoods(goods) {
				this.$emit('submitGetGoods', goods);
			}
		}
	};
</script>

<style lang="scss">
	.goodsList {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}
</style>